<?php echo $javascript->link('jquery.min.js', false); ?>
<?php echo $javascript->link('jquery-ui-1.7.2.custom.min.js', false); ?>
<?php echo $javascript->link('button', false); ?>

<?php echo $javascript->codeBlock('
    $(document).ready(function() {
        $("#UserUsername").focus();
    });
', array('inline' => false)); ?>

<div id="login" class="ui-widget ui-widget-content ui-corner-all">
    <div class="ui-widget-header">用户登录</div>

    <?php if ($session->check('Message.auth')): ?>
    <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all" style="margin: 0.5em 0; padding: 0.7em; text-align: left;">
            <span class="ui-icon ui-icon-alert" style="float: left; margin-right: 0.3em;"></span>
            <?php $session->flash(); $session->flash('auth'); ?>
        </div>
    </div>
    <?php endif; ?>

<?php
    echo $form->create('User', array('action' => 'login'));
    echo $form->input('username',
                      array('label' => __('Username', true),
                            'type' => 'text'));
    echo $form->input('password',
                      array('label' => __('Password', true)));
    echo $form->end(array('label' => __('Login', true), 'class' => 'fg-button ui-state-default ui-corner-all')); 
?>
</div>
